package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 角色类
 */
@Data
@ApiModel(value = "角色类")
@TableName("t_role")
public class RoleBean {
    /*
    （角色编号，角色名称，权限集合）
     */
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_roleId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "角色名称")
    @TableField("r_name")
    private String name;
    @ApiModelProperty(value = "权限集合")
    @TableField(exist = false)
    private List<GradeBean> gradeList;

    public RoleBean() {
    }

    public RoleBean(String name) {
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    @Override
    public String toString() {
        return "\nRoleBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gradeList=" + gradeList +
                '}';
    }
}
